function reverseString(str) {
    str = Array.from(str).reverse().join("");
    return str;
}

reverseString("hello");